#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef double real;
int p;
struct vector
{
    real x;real y;real z;
}
typedef vector;
int main()
{
    void dayin();
    void model();
    void normal();
    void add();
    void fushu();
    void sub();
    void muls();
    void mulv();
    void crossv();
    void costheta();
    //声明部分
    int k;
    printf("what do you want me to do?\n");
    printf("if you wanna give me a vector and print it,kou 0\n");
    printf("if you wanna me to give the model,kou 1\n");
    printf("if you wanna me to give the normal,kou 2\n");
    printf("if you wanna me to give the neg,kou 3\n");
    printf("if you wanna me to give the add,kou 4\n");
    printf("if you wanna me to give the subv,kou 5\n");
    printf("if you wanna me to give the muls,kou 6\n");
    printf("if you wanna me to give the mulv,kou 7\n");
    printf("if you wanna me to give the cross,kou8\n");
    printf("if you wanna me to give the cos between vector,kou 9\n");
    scanf("%d",&k);
    if(k==0)
    {
        dayin();
    }
    if(k==1)
    {
        model();
    }
    if(k==2)
    {
        normal();
    }
    if(k==4)
    {
        add();
    }
    if(k==3)
    {
        fushu();
    }
    if(k==5)
    {
        sub();
    }
    if(k==6)
    {
        muls();
    }
    if(k==7)
    {
        mulv();
    }
    if(k==8)
    {
        crossv();
    }
    if(k==9)
    {
        costheta();
    }
        return 0;
}
void dayin()
{
    vector v;
    printf("please give me the vector");
    scanf("%lf%lf%lf",&v.x,&v.y,&v.z);
    printf("the vector is (%.0lf,%.0lf,%.0lf)",v.x,v.y,v.z);
}
void model()
{
    double x;
    vector v;
    printf("please give me vector");
    scanf("%lf%lf%lf",&v.x,&v.y,&v.z);
    x=sqrt(v.x*v.x+v.y*v.y+v.z*v.z);
    printf("the anwser is %.2lf",x);

    
}
void normal()
{   double x;
    vector v;
    printf("please give me vector");
    scanf("%lf%lf%lf",&v.x,&v.y,&v.z);
    x=sqrt(v.x*v.x+v.y*v.y+v.z*v.z);
    v.x=v.x/x;v.y=v.y/x;v.z=v.z/x;
    printf("the anwser is (%.3lf,%.3lf,%.3lf)",v.x,v.y,v.z);
}
void add()
{
    vector v;
    vector v1;
    printf("please give me vector");
    scanf("%lf%lf%lf",&v.x,&v.y,&v.z);
    printf("please give me another vector");
    scanf("%lf%lf%lf",&v1.x,&v1.y,&v1.z);
    v.x=v.x+v1.x;v.y=v.y+v1.y;v.z=v.z+v1.z;
    printf("the anwser is (%.0lf,%.0lf,%.0lf)",v.x,v.y,v.z);    
}
void fushu()
{
    vector v;
    printf("please give me vector");
    scanf("%lf%lf%lf",&v.x,&v.y,&v.z);
    printf("the anwser is (%.0lf,%.0lf,%.0lf)",-v.x,-v.y,-v.z);
}
void sub()
{   
    vector v;
    vector v1;
    printf("please give me vector");
    scanf("%lf%lf%lf",&v.x,&v.y,&v.z);
    printf("please give me another vector");
    scanf("%lf%lf%lf",&v1.x,&v1.y,&v1.z);
    v.x=v.x-v1.x;v.y=v.y-v1.y;v.z=v.z-v1.z;
    printf("the anwser is (%.0lf,%.0lf,%.0lf)",v.x,v.y,v.z);    
}
void muls()
{
    vector v;
    double x;
    printf("please give me vector");
    scanf("%lf%lf%lf",&v.x,&v.y,&v.z);
    printf("please give me a number");
    scanf("%lf",&x);
    v.x=v.x*x;v.y=v.y*x;v.z=v.z*x;
    printf("the anwser is (%.0lf,%.0lf,%.0lf)",v.x,v.y,v.z);    
}
void mulv()
{
    vector v;
    vector v1;
    double x;
    printf("please give me vector");
    scanf("%lf%lf%lf",&v.x,&v.y,&v.z);
    printf("please give me another vector");
    scanf("%lf%lf%lf",&v1.x,&v1.y,&v1.z);
    x=v.x*v1.x+v.y*v1.y+v.z*v1.z;
    printf("the anwser is %.2lf",x);
}
void crossv()
{
    vector v;
    vector v1;
    vector v2;
    printf("please give me vector");
    scanf("%lf%lf%lf",&v.x,&v.y,&v.z);
    printf("please give me another vector");
    scanf("%lf%lf%lf",&v1.x,&v1.y,&v1.z);
    v2.x=v.y*v1.z-v.z*v1.y;v2.y=v.z*v1.x-v.x*v1.z;v2.z=v.x*v1.y-v.y*v1.x;
    printf("the anwser is (%.0lf,%.0lf,%.0lf)",v2.x,v2.y,v2.z);    

}
void costheta()
{
    vector v;
    vector v1;
    double x;
    double y;
    double z;
    double d;
    printf("please give me vector");
    scanf("%lf%lf%lf",&v.x,&v.y,&v.z);
    printf("please give me another vector");
    scanf("%lf%lf%lf",&v1.x,&v1.y,&v1.z);
    x=v.x*v1.x+v.y*v1.y+v.z*v1.z;
    y=sqrt(v.x*v.x+v.y*v.y+v.z*v.z);
    z=sqrt(v1.x*v1.x+v1.y*v1.y+v1.z*v1.z);   
    d=x/(y*z);
    printf("the anwser is %.2lf",d);

}

